package com.sun.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sun.entity.QuartzBean;
import org.quartz.SchedulerException;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Project: hospitalDrugInformationManagement
 * @Author: 86178
 * @Date: 2023/3/29 18:08
 * @FileName: QuartzService
 * @Description: ""
 */
public interface QuartzService extends IService<QuartzBean> {
    int insertJob(QuartzBean quartzBean);

    int updateJob(QuartzBean quartzBean);

    @Transactional(rollbackFor = Exception.class)
    int pauseJob(QuartzBean quartzBean);

    @Transactional(rollbackFor = Exception.class)
    int resumeJob(QuartzBean job) throws SchedulerException;

    @Transactional(rollbackFor = Exception.class)
    int deleteJob(QuartzBean job) throws SchedulerException;

    @Transactional(rollbackFor = Exception.class)
    void deleteJobByIds(Long[] jobIds) throws SchedulerException;

    @Transactional(rollbackFor = Exception.class)
    int changeStatus(QuartzBean job) throws SchedulerException;

    @Transactional(rollbackFor = Exception.class)
    boolean run(QuartzBean job) throws SchedulerException;
}
